<template>
    <view :style="themeColor">
        <view class="page" >
    <view class="flex benben-position-layout flex flex-wrap align-center exchangeRecords_flex_0"    :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
            <view   class='flex flex-wrap align-center justify-between flex-sub exchangeRecords_fd0_0'      >
            <view   class='flex flex-wrap align-center exchangeRecords_fd0_0_c0'   @tap.stop="handleJumpDiy" data-type="back" data-url="1"   >
        <text class='fu-iconfont2  exchangeRecords_fd0_0_c0_c0'  >&#xe794;</text>
</view>
<text class='exchangeRecords_fd0_0_c1'  >兑换记录</text>
    <view   class='flex flex-wrap align-center exchangeRecords_fd0_0_c0'      >
        </view>
</view>

        </view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"  ></view>
<!---flex布局flex布局开始-->
 <view class="flex benben-flex-layout flex-wrap align-center"    >
        <view>
        <benben-flex-tabs class-name='exchangeRecords_benbenTabsfd1_0'  v-model="tabs" ref="benben_tabsfd1_0" select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false' :open-sticky='true' :top='88' :is-show-content='false' :scrollspy='false'  :tabs-info.sync="tabsInfofd1_0" @change="DataListFunc()" >
            
                    <scroll-view
          @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft"
          id="benben_tabsfd1_0"
          class="benben-tabs"
          style="width:750rpx"
          :scroll-x="true"
          :scroll-left.sync="tabsInfofd1_0.moveX"
          scroll-with-animation="all .3s ease"
        >
          <view class="benben-tabs-content" id="benben_tabsfd1_0-content">
            <view id="benben_tabsfd1_0-title" class="benben-tabs-title flex flex align-center justify-around">
                        <view 
                :class="{ 'checkTitlefd1_0': tabs == '0', 'flex flex-wrap align-center': true }"
                @tap="tabs = '0'"
                :id="`benben_tabsfd1_0-title-item-${'0'}`"
                
                
              >
                
<text   >全部</text>

              </view>            <view 
                :class="{ 'checkTitlefd1_0': tabs == '10', 'flex flex-wrap align-center': true }"
                @tap="tabs = '10'"
                :id="`benben_tabsfd1_0-title-item-${'10'}`"
                
                
              >
                
<text   >待发货</text>

              </view>            <view 
                :class="{ 'checkTitlefd1_0': tabs == '15', 'flex flex-wrap align-center': true }"
                @tap="tabs = '15'"
                :id="`benben_tabsfd1_0-title-item-${'15'}`"
                
                
              >
                
<text   >待收货</text>

              </view>            <view 
                :class="{ 'checkTitlefd1_0': tabs == '20', 'flex flex-wrap align-center': true }"
                @tap="tabs = '20'"
                :id="`benben_tabsfd1_0-title-item-${'20'}`"
                
                
              >
                
<text   >已完成</text>

              </view>
            </view>
            <view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}" id="benben_tabsfd1_0-line" class="benben-tabs-line flex benben-flex-tabs-line exchangeRecords_linefd1_0"></view>
          </view>
        </scroll-view>
            
        </benben-flex-tabs>
        
</view>
</view>
        
<!---flex布局flex布局结束-->
<!---兑换列表flex布局开始-->
 <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout exchangeRecords_flex_2"    >
            <template v-for = '(item,key0) in dataList'>
    <view   class='flex flex-direction flex-wrap align-stretch exchangeRecords_fd2_0'       :key='key0'>
            <view   class='flex flex-wrap align-center'      >
        <text class='exchangeRecords_fd2_0_c0_c0'  >订单编号：</text>
<text class='flex-sub exchangeRecords_fd2_0_c0_c1'  >{{item.dingdanbianhao}}</text>
<text class='exchangeRecords_fd2_0_c0_c2'    v-if= " item.dingdanzhuangtai=='10'"  >待发货</text><text class='exchangeRecords_fd2_0_c0_c2'    v-if= " item.dingdanzhuangtai=='15'"  >待收货</text><text class='exchangeRecords_fd2_0_c0_c2'    v-if= " item.dingdanzhuangtai=='25'"  >已完成</text>
</view>
    <view   class='flex flex-wrap align-start exchangeRecords_fd2_0_c1'   @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/integral/redemptDetails/redemptDetails?id=${item.aid}`"   >
        <image class='exchangeRecords_fd2_0_c1_c0'  mode="aspectFill"  :src='item.integralgoods_tupian'></image>
    <view   class='flex flex-direction flex-wrap align-stretch justify-between flex-sub exchangeRecords_fd2_0_c1_c1'      >
        <text class='exchangeRecords_fd2_0_c1_c1_c0'  >{{item.integralgoods_name}}</text>
    <view   class='flex flex-wrap align-center justify-between'      >
            <view   class='flex flex-wrap align-center'      >
        <text class='exchangeRecords_fd2_0_c1_c1_c1_c0_c0'  >{{item.jifen}}</text>
<text class='exchangeRecords_fd2_0_c1_c1_c1_c0_c1'  >积分</text>
</view>
</view>
</view>
</view>
    <view   class='flex flex-wrap align-center justify-end exchangeRecords_fd2_0_c2'      >
        <button class='exchangeRecords_fd2_0_c2_c0'  @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/integral/redemptDetails/redemptDetails?id=${item.aid}`"  >查看详情</button>
<button class='exchangeRecords_fd2_0_c2_c1'  @tap.stop="remindShipmentFunc(item.aid)" v-if= " item.dingdanzhuangtai=='10'" >提醒发货</button><button class='exchangeRecords_fd2_0_c2_c1'  @tap.stop="sureFunc(item.aid)" v-if= " item.dingdanzhuangtai=='15'" >确认收货</button><button class='exchangeRecords_fd2_0_c2_c1'  @tap.stop="deleteFunc(item.aid)" v-if= " item.dingdanzhuangtai=='25'" >删除订单</button>
</view>
</view>
    </template>
    <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData" :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
</view>
        
<!---兑换列表flex布局结束-->
    
    
        </view>
    </view>
</template>
<script>
    import pagingList from '@/common/mixin/paging_list.js';
import {validate} from '@/common/utils/validate.js'
    
    export default {
        components:{},
        mixins: [pagingList],
        
        data(){
			return {"tabsInfofd1_0":{ lineleft: '', lineWidth: '', moveX: 0, scrollX: 0, PageScrollX: 0 },"minixPagingListsApi":"","pageingListApiMethod":"","allowOnloadGetList":false,"tabs":"0","dataList":[]};
		},
		computed:{
            themeColor() {
              return this.$store.getters.themeColor
            },
            
		},
		watch:{},
		onLoad(options){
            this.DataListFunc()
		},
        onUnload() {
                
        },
		onReady(){
            
		},
		onShow(){
            
		},
		onHide(){
            
		},
		onResize(){
            
		},
		onPullDownRefresh(){
            this.DataListFunc()
		},
		onReachBottom(e){
            
		},
		onPageScroll(e){
            
		},
		methods:{
                            //获取积分订单列表
                 DataListFunc(){
                                    this.minixPagingListsApi = global.apiUrls.post63c6584847e9e;
                this.pageingListApiMethod = 'get';
                this.allowOnloadGetList = false;
                this.pagingListPostDataContent = {dingdanzhuangtai:this.tabs}
                this.listData = [];
                this.dataList = this.listData;
                this.pagingListToggle();
                
                },
                //确认收货
                async sureFunc(sureID){
                        //请求方法
    //数据验证
    
  let data63d9db9e28e5c = await this.$api.post(global.apiUrls.post63d9db9e28e5c, {
    aid:sureID
  });
  
  if (data63d9db9e28e5c.data.code != 1) {
    this.$message.info(data63d9db9e28e5c.data.msg);
    return
  } 
  
  
  
                    this.$message.info('收货成功');
                setTimeout(()=>{
                            this.DataListFunc()
      },500)
                },
                //提醒发货
                async remindShipmentFunc(remindShipmentID){
                        //请求方法
    //数据验证
    
  let data63da0d854be17 = await this.$api.post(global.apiUrls.post63da0d854be17, {
    integralorder_id:remindShipmentID
  });
  
  if (data63da0d854be17.data.code != 1) {
    this.$message.info(data63da0d854be17.data.msg);
    return
  } 
  
  
  
                    this.$message.info('已提醒商家发货');
                setTimeout(()=>{
                            this.DataListFunc()
      },500)
                },
                //删除订单
                async deleteFunc(deleteID){
                        //请求方法
    //数据验证
    
  let data648975e8d31c2 = await this.$api.get(global.apiUrls.post648975e8d31c2, {
    aid:deleteID
  });
  
  if (data648975e8d31c2.data.code != 1) {
    this.$message.info(data648975e8d31c2.data.msg);
    return
  } 
  
  
  
                    this.$message.info('删除成功');
                setTimeout(()=>{
                            this.DataListFunc()
      },500)
                },
                pagingListPostData(){
                    return this.pagingListPostDataContent
                }
		}
    };
</script> 
<style lang="scss" scoped>
           .page{
            width: 100vw;
            overflow-x: hidden;
            min-height: calc(100vh - var(--window-bottom));
            background:rgba(248, 248, 248, 1);background-size: 100% auto;
        }
    .exchangeRecords_flex_0{
        border-bottom:1px solid #eee;background:#fff;width:750rpx;height:88rpx;overflow:hidden;z-index:10;top:0rpx;background-size:100% auto !important;
    }
    .exchangeRecords_fd0_0_c1{
        font-size:36rpx;font-weight:500;color:#333;
    }
    .exchangeRecords_fd0_0_c0_c0{
        font-size:32rpx;color:#333;
    }
    .exchangeRecords_fd0_0_c0{
        width:120rpx;height:88rpx;
    }
    .exchangeRecords_fd0_0{
        padding:0rpx 32rpx 0rpx 32rpx;height:88rpx;
    }
    .exchangeRecords_linefd1_0{
        background:var(--benbenbgColor2);width:40rpx;height:8rpx;top:80rpx;background-size:100% auto !important;border-radius:16rpx 16rpx 16rpx 16rpx;
    }
    .checkTitlefd1_0{
        font-weight:700 !important;font-size:28rpx !important;color:#E31D1A !important;background-color:rgba(255, 255, 255, 1) !important;
    }
    ::v-deep .exchangeRecords_benbenTabsfd1_0{
        background:#fff;width:750rpx;height:90rpx;white-space:nowrap;text-align:center;font-size:28rpx;font-weight:400;color:#333;
    }
    .exchangeRecords_flex_2{
        padding:12rpx 24rpx 0rpx 24rpx;
    }
    .exchangeRecords_fd2_0_c2_c1{
        background:var(--benbenbgColor2);border-radius:28rpx 28rpx 28rpx 28rpx;font-size:24rpx;color:#fff;width:160rpx;height:56rpx;line-height:56rpx;margin:0rpx 0rpx 0rpx 24rpx;
    }
    .exchangeRecords_fd2_0_c2_c0{
        background:rgba(246, 246, 246, 1);border-radius:28rpx 28rpx 28rpx 28rpx;font-size:24rpx;color:#333;width:160rpx;height:56rpx;line-height:56rpx;
    }
    .exchangeRecords_fd2_0_c2{
        border-top:1px solid #eee;padding:24rpx 0rpx 32rpx 0rpx;
    }
    .exchangeRecords_fd2_0_c1_c1_c1_c0_c1{
        line-height:36rpx;font-size:22rpx;font-weight:700;color:#333333;
    }
    .exchangeRecords_fd2_0_c1_c1_c1_c0_c0{
        line-height:36rpx;font-size:32rpx;font-weight:700;color:#F02325;
    }
    .exchangeRecords_fd2_0_c1_c1_c0{
        line-height:45rpx;font-size:28rpx;font-weight:500;color:#333333;-webkit-line-clamp:1;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;
    }
    .exchangeRecords_fd2_0_c1_c1{
        margin:0rpx 0rpx 0rpx 24rpx;height:200rpx;
    }
    .exchangeRecords_fd2_0_c1_c0{
        width:200rpx;height:200rpx;border-radius:16rpx 16rpx 16rpx 16rpx;
    }
    .exchangeRecords_fd2_0_c1{
        padding:32rpx 0rpx 32rpx 0rpx;
    }
    .exchangeRecords_fd2_0_c0_c2{
        line-height:40rpx;font-size:28rpx;font-weight:500;color:rgba(230, 0, 54, 1);
    }
    .exchangeRecords_fd2_0_c0_c1{
        -webkit-line-clamp:1;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;line-height:40rpx;font-size:28rpx;font-weight:400;color:#666666;margin:0rpx 32rpx 0rpx 0rpx;
    }
    .exchangeRecords_fd2_0_c0_c0{
        line-height:40rpx;font-size:28rpx;font-weight:400;color:#666666;
    }
    .exchangeRecords_fd2_0{
        background:#fff;border-radius:16rpx 16rpx 16rpx 16rpx;background-size:100% auto !important;padding:32rpx 24rpx 0rpx 24rpx;margin:12rpx 0rpx 12rpx 0rpx;
    }
</style>